package analyticsServer;

import auctionServer.eventHierarcy.UserEvent;
import auctionServer.eventService.EventServer;

import java.rmi.RemoteException;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

/**
 * Created with IntelliJ IDEA.
 * To change this template use File | Settings | File Templates.
 */
public class EventManager extends UnicastRemoteObject implements EventServer {

    protected EventManager() throws RemoteException {
        super();
        int registryPort = 20013;
        String registryHost = "localhost";

        java.rmi.registry.LocateRegistry.createRegistry(registryPort);
        Registry registry = java.rmi.registry.LocateRegistry.getRegistry(registryHost, registryPort);
        try {
            registry.rebind("EventServer", this);
        } catch (RemoteException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
            return;
        }

        System.out.println ("Service bound....");
    }

    @Override
    public void notifyUserEvent(UserEvent event) throws RemoteException{
        //To change body of implemented methods use File | Settings | File Templates.
    }
}
